<?php
class TodoModel extends  CommonModel {
    protected $_auto = array(
        array('create_time','time',1,'function'),
        array('update_time','time',2,'function'),
        array('start_time','strtotime',3,'function'),
        array('end_time','strtotime',3,'function'),
        array('alert_time','getTime',3,'callback'),
        array('user_id','getUser',3,'callback'),
    );

    public $_validate	=	array(
		array('subject','require','计划任务名称必须填写！'),
		);

    public function getUser(){
        return $_SESSION[C('USER_AUTH_KEY')];
    }

    protected function getTime($alert_time){
        return empty($_POST['alert_time'])?0:strtotime( $_POST['alert_time'] );
    }

}
?>
